<template>
    <div class="text-item">
        <h2>
            <span
                v-for="(v, index) in banner.title"
                :key="index"
                :style="`animation-delay: ${(index + 1) * 0.05}s;`"
                >{{ v }}</span
            >
        </h2>
        <em v-for="(n, index) in banner.text" :key="index">
            <AnimateTextWave :list="n" />
        </em>
    </div>
</template>

<script>
export default {
    name: "blog-banner",
    data() {
        return {
            banner: {
                title: ["知", "识", "改", "变", "命", "运"],
                text: [
                    ["日", "日", "行", ",", "不", "怕", "千", "万", "里"],
                    ["常", "常", "做", ",", "不", "怕", "千", "万", "事"],
                    [
                        "我",
                        "是",
                        "个",
                        "拙",
                        "笨",
                        "的",
                        "学",
                        "艺",
                        "者",
                        ",",
                        "没",
                        "有",
                        "充",
                        "分",
                        "的",
                        "天",
                        "才",
                        ",",
                        "全",
                        "凭",
                        "苦",
                        "学",
                    ],
                ],
            },
        };
    },
};
</script>

<style lang="less" scoped>
.text-item {
    h2 {
        position: absolute;
        top: -100%;
        left: 0px;
        margin: 0 auto;

        span {
            display: block;
        }

        &::after {
            content: "";
            position: absolute;
            height: 90%;
            width: 3px;
            background: gold;
            right: -15px;
            bottom: 8px;
        }
    }

    em {
        margin-left: 80px;
    }
    @media (max-width: 768px) {
        em {
            display: none;
        }
        h2 {
            position: static;
            font-size: 18px !important;
            span {
                display: inline-block;
            }

            &::after {
                width: 50%;
                height: 2px;
                bottom: -5px;
                right: 50%;
                transform: translate(50%);
            }
        }
    }
}
</style>